def isprime(n):
    # make sure n is a positive integer
    n = abs(n)

    # 0 and 1 are not prime
    if n < 2:
        return False

    # 2 is prime
    if n == 2:
        return True

    # all other even numbers are not prime
    if not n & 1:
        return False

    # only need to go up to squareroot of n, start from 3
    for x in range(3, int(n**0.5)+1, 2):
        if n % x ==0:
            return False

    return True


i = 1
num = 2
while i < 10001:
    num += 1
    if isprime(num):
        print num
        i += 1

print num